package fresponse

import (
	"gitee.com/xluomo945/fm/ftype"
	"github.com/gin-gonic/gin"
	"net/http"
)

type MPicture interface {
	response
}

type image struct {
	ext  ftype.ImageType
	data []byte
}

func (f image) Assemble(ctx *gin.Context) {
	ctx.Data(http.StatusOK, string(f.ext), f.data)
}

func Picture(ext ftype.ImageType, data []byte) MPicture {
	return &image{ext: ext, data: data}
}
